package com.gqyin.jpa.domain;

import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author guiqing.yin
 * @Date 2024-04-30 11:00
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@EntityListeners(AuditingEntityListener.class)
public class Blog extends BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 2448859846330400695L;

    private String title;

    @ManyToOne(targetEntity = User.class)
    private User author;

    private Integer likesCount;

    private Integer favoritesCount;
}
